;; syntax-help
;; include this in your init.lsp for syntax commandline help on Windows
;;
;; example:
;;   > (help C)
;;   syntax: (starts-with <str str-key> [<num-option>] )
;;   syntax: (starts-with <list> [<expr>] )
;;
;; For Nix change the manual path accordingly

(define-macro (help)
	(let ((func-name  (string (args 0))) (errstr ""))
			(catch
				(dolist (item
					(find-all (format {(syntax: \(%s .*?\))} func-name)
						(read-file "./newlisp_manual.html") $1)) ; Win32
					(replace "<em>" item "<")
					(replace "</em>" item ">")
					(println  item ""))
				'errstr
			)
			(if (empty? errstr) "^_^" (format "Can't Found syntax of the %s" func-name ))
			))

;; eof



(define (rename-exts dir oldname-pattern newname-ext , files)
		(change-dir dir)
		(set 'files (directory dir))
		(when files
			(ref-all oldname-pattern files 
				(fn (x y) 
					(if (find x y 1) 
						(rename-file y  (append y newname-ext)))
				)
            true)
          )
)

